insheet using "C:\korea.csv", clear

generate group=gubun
replace group=0 if gubun==1
replace group=1 if gubun==2
sort group

**variable construction (gubun=1:control, gubun=1:treatment)
label variable group "Japan-ROK Air Movie" 

//socioeconomic
gen male = q1 
label variable male "Male"
gen college = 0 
replace college=1 if q4==4 
label variable college "College Education"
drop if college == 0 

//political opinion
gen pol_interest = 0
replace pol_interest=1 if q6==4 
replace pol_interest=1 if q6==3 
label variable pol_interest "High Political Interest"
gen pol_right = q8
label variable pol_right "Political Right"

//key question
label variable q10_1 "Stronger Claim Takeshima"
label variable q10_2 "More Economic Cooperation"
label variable q10_3 "More Security Cooperation"
label variable q10_4 "Case by Case Cooperation"
label variable q10_5 "More Envi. Protection Cooperation"
label variable q10_6 "More Disaster Prevention Cooperation"

label variable q11_1 "More Compaies from ROK"
recode q11_1 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q11_2 "More Students from ROK"
recode q11_2 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q11_3 "Turn into ROK on Takeshima"
recode q11_3 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q11_4 "Takeshima issue should be settled by ICJ"
recode q11_4 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q11_5 "Power Parity with ROK"
recode q11_5 (1=5)(2=4)(3=3)(4=2)(5=1)
label variable q11_6 "Turn into ROK on Confort Women"
recode q11_6 (1=5)(2=4)(3=3)(4=2)(5=1)


* Hypothesis test of H1
sort group
by group: sum q13_3
by group: sum q14_2

* Hypothesis test of H2/3

sort group

ttest q10_1, by(group) w
ttest q10_2, by(group) w
ttest q10_3, by(group) w
ttest q10_4, by(group) w
ttest q10_5, by(group) w
ttest q10_6, by(group) w

ttest q11_1, by(group) w
ttest q11_2, by(group) w
ttest q11_3, by(group) w
ttest q11_4, by(group) w
ttest q11_5, by(group) w
ttest q11_6, by(group) w


ttest q13_2, by(group) w
ttest q13_1, by(group) w
ttest q13_3, by(group) w
ttest q13_4, by(group) w

ttest q14_2, by(group) w
ttest q14_1, by(group) w
ttest q14_3, by(group) w
ttest q14_4, by(group) w

ttest q18_1, by(group) w
ttest q18_2, by(group) w

**calculation for MC
tab q10_1 group, col
tab q10_2 group, col
tab q10_3 group, col
tab q10_4 group, col
tab q10_5 group, col
tab q10_6 group, col
tab q18_1 group, col
tab q18_2 group, col

**analysis using regression models
cor group male college pol_interest pol_right
sum group male college pol_interest pol_right
reg q10_3 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie01k.pdf, replace
reg q10_2 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie02k.pdf, replace
reg q10_4 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie03k.pdf, replace
reg q10_5 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie04k.pdf, replace
reg q10_6 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie05k.pdf, replace
reg q18_1 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("JSDF with US Should Help ROK") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie07k.pdf, replace
reg q10_1 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Stronger Claim Takeshima") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie08k.pdf, replace


**generate additional variables and additional regression on sub-groups (left, right, gender, partyID)
generate left=0
generate right=0
generate park_party=0
generate liberal_party=0
replace left=1 if q8<4
replace right=1 if q8>5
replace park_party=1 if q7==2
replace park_party=1 if q7==4
replace liberal_party=1 if q7==1
replace liberal_party=1 if q7==5
label variable left "Left"
label variable right "Right"
label variable park_party "Park Supporters"
label variable park_party "Anti-Park Supporters"
reg q10_3 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie30k.pdf, replace
reg q10_3 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie31k.pdf, replace
reg q10_3 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie32k.pdf, replace
reg q10_3 group##park_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie33k.pdf, replace
reg q10_3 group##liberal_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie34k.pdf, replace

reg q10_2 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie30ek.pdf, replace
reg q10_2 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie31ek.pdf, replace
reg q10_2 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie32ek.pdf, replace
reg q10_2 group##park_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie33ek.pdf, replace
reg q10_2 group##liberal_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Moviee34ek.pdf, replace

reg q10_4 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie30cbck.pdf, replace
reg q10_4 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie31cbck.pdf, replace
reg q10_4 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie32cbck.pdf, replace
reg q10_4 group##park_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie33cbck.pdf, replace
reg q10_4 group##liberal_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Moviee34cbck.pdf, replace

reg q10_5 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie30epk.pdf, replace
reg q10_5 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie31epk.pdf, replace
reg q10_5 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie32epk.pdf, replace
reg q10_5 group##park_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie33epk.pdf, replace
reg q10_5 group##liberal_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Moviee34epk.pdf, replace

reg q10_6 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie30dpk.pdf, replace
reg q10_6 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie31dpk.pdf, replace
reg q10_6 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie32dpk.pdf, replace
reg q10_6 group##park_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie33dpk.pdf, replace
reg q10_6 group##liberal_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Moviee34cbck.pdf, replace


**attentive audience only**
drop if q9_1 ==.
drop if q9_2 ==. & group==0
drop if q9_4 ==. & group==1
reg q10_3 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie40k.pdf, replace
reg q10_3 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie41k.pdf, replace
reg q10_3 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie42k.pdf, replace
reg q10_3 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie43k.pdf, replace
reg q10_3 group##park_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie44k.pdf, replace
reg q10_3 group##liberal_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Security Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie45.pdf, replace

reg q10_2 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie40ek.pdf, replace
reg q10_2 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie41ek.pdf, replace
reg q10_2 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie42ek.pdf, replace
reg q10_2 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie43ek.pdf, replace
reg q10_2 group##park_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie44ek.pdf, replace
reg q10_2 group##liberal_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Economic Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Moviee45ek.pdf, replace

reg q10_4 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie40cbck.pdf, replace
reg q10_4 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie41cbck.pdf, replace
reg q10_4 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie42cbck.pdf, replace
reg q10_4 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie43cbck.pdf, replace
reg q10_4 group##park_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Movie44cbck.pdf, replace
reg q10_4 group##liberal_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("Case by Case Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1) levels(90)
graph export graph_Moviee45cbck.pdf, replace

reg q10_5 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie40epk.pdf, replace
reg q10_5 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie41epk.pdf, replace
reg q10_5 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie42epk.pdf, replace
reg q10_5 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie43epk.pdf, replace
reg q10_5 group##park_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie44epk.pdf, replace
reg q10_5 group##liberal_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Envi. Protection Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Moviee45epk.pdf, replace

reg q10_6 group male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie40dpk.pdf, replace
reg q10_6 group##left male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie41dpk.pdf, replace
reg q10_6 group##right male college pol_interest
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie42dpk.pdf, replace
reg q10_6 group##male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie43dpk.pdf, replace
reg q10_6 group##park_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Movie44dpk.pdf, replace
reg q10_6 group##liberal_party male college pol_interest pol_right
coefplot, drop(_cons) xline(0) xtitle("More Disaster Prevention Cooperation") graphregion(color(white)) mlabel format(%9.2g) mlabposition(1)
graph export graph_Moviee45cbck.pdf, replace

**analysis (agree=5; disagree=1)
sum q2_1 male college pol_interest park_party liberal_party if group==1
sum q2_1 male college pol_interest park_party liberal_party if group==0
